<template>
  <div class="mySwipe">
    <van-swipe class="my-swipe" :show-indicators="false" :autoplay="3000" indicator-color="white">
      <van-swipe-item v-for="image in images" :key="image">
        <img :src="image" />
      </van-swipe-item>
    </van-swipe>
  </div>
</template>

<script>
import { reactive, toRefs } from "@vue/reactivity";
import { onBeforeMount } from "@vue/runtime-core";
export default {
  props: ["images"],
  setup() {
    const state = reactive({});
    onBeforeMount(async () => {});
    return {
      ...toRefs(state),
    };
  },
};
</script>

<style lang="less" scoped>
.mySwipe {
  box-sizing: border-box;
  margin: 0 auto;
  width: 100%;
  margin: 10px 0;
}
.my-swipe .van-swipe-item {
  box-sizing: border-box;
  height: 30vh;
  color: #fff;
  font-size: 20px;
  line-height: 150px;
  text-align: center;
  padding: 0 10px;
  img {
    width: 100%;
    height: 30vh;
    background-size: cover;
    border-radius: 10px;
  }
}
</style>
